<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/4/24/024
 * Time: 20:12
 */

namespace app\admin\validate;

class MemberValidate extends \think\Validate
{

    const SCENE_ADD = 'add'; //添加用户
    const SCENE_DEL = 'del'; //删除用户


    protected $rule = [
        'id' => 'require|number',
        'pwd' =>  'require|max:32',
        'tel' =>  'require|max:32',
    ];


    protected $message  = [
        'id.require' => 'ID不能为空',
        'id.number' => 'ID必须为数字',

    ];

    protected $scene  = [
       self::SCENE_ADD => ['tel', 'pwd'],
       self::SCENE_DEL => ['id'],
    ];

}